package de.vogella.mysql.first;



import javax.swing.JFrame;
import java.net.*;
import javax.media.*;
import java.io.*;
import java.awt.*;


public class SimplePalyer1 extends JFrame {
	private final static long serialVersionUID = 15L;
	private Player player;
       

	public SimplePalyer1(String title,URL url){
		super(title);
		Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, true);
		try{
			createPlayerAndShowComponents(url);
			
		}catch(CannotRealizeException ex){
			ex.printStackTrace();
		}
		catch(NoPlayerException ex){
			ex.printStackTrace();
		}
		catch(IOException ex){
			ex.printStackTrace();
		}
		
		//player.start();
	}

    SimplePalyer1(String string, String string0) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
	
	public  void createPlayerAndShowComponents(URL url) throws IOException, NoPlayerException, CannotRealizeException 
	{
		player = Manager.createRealizedPlayer(url);
              
		Component comp;
		if((comp = player.getVisualComponent()) != null)
			add(comp, BorderLayout.CENTER);
		if((comp = player.getVisualComponent()) != null)
			add(comp, BorderLayout.CENTER);
		if((comp = player.getControlPanelComponent()) != null)
			add(comp, BorderLayout.SOUTH);
                
                   
               			add(comp, BorderLayout.SOUTH);

		
		
		
	}
}
